<template>
    <div class="author">
        <van-image round width="1rem" height="1rem" fit="fill"
        :src="author.aut_photo"/>
        <div class="text">
          <p class="name">{{ author.aut_name }}</p>
          <!-- relativeTime 表示相对时间，是main.js中定义的全局过滤器 -->
          <p class="time">{{author.pubdate | relativeTime}}</p>
        </div>
        <!-- 调用接口 -->
       <slot>
           <!-- 默认插槽 -->
       </slot>
    </div>
</template>

<script>
export default {
  name: 'Author',
  // props: ['author']
  props: {
    author: {
      type: Object,
      required: true
    }
  }
}
</script>

<style scoped lang="less">
    .author {
    padding: 10px 0;
    display: flex;
    .text {
      flex: 1;
      padding-left: 10px;
      line-height: 1.3;
      .name {
        font-size: 14px;
        margin: 0;
      }
      .time {
        margin: 0;
        font-size: 12px;
        color: #999;
      }
    }
  }
</style>
